let arr = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
let res1 = arr.reduce((prev, cur) => { return prev + cur }, 0)
console.log(res1);
let arr1 = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
let res2 = arr1.flat(Infinity).reduce((prev, cur) => { return prev + cur }, 0)
console.log(res2);
let arr3 = [{ a: 9, b: 3, c: 4 }, { a: 1, b: 3 }, { a: 3 }]
let res3 = arr3.reduce((prev, cur) => {
  return prev + cur["a"];
}, 0)
console.log(res3);